import { RoomObject } from './share/RoomObject'
import type { Point2D } from '@/RoomDesign/application/dto/Point2D'
import type { Point3D } from '@/RoomDesign/application/dto/Point3D'
import type { Zone } from './Zone'
import { enMaterialType, enClassName, enTextureType } from '../global/enumHelper'
import type { MaterialParams, TextureParams } from '../global/typeHelper'

export class Floor extends RoomObject {
  className = enClassName.Floor
  private _path: Point2D[] = []
  private _position: Point3D
  private _zone: Zone | null = null
  private _textureParams: TextureParams
  private _materialParams: MaterialParams
  constructor(
    path: Point2D[],
    position: Point3D,
    textureParams?: TextureParams,
    materialParams?: MaterialParams,
  ) {
    super()
    this._path = path
    this._position = position

    if (textureParams) {
      this._textureParams = textureParams
    } else {
      this._textureParams = {
        imgUrl: 'texture/floor/graw.jpg',
        textureType: enTextureType.single,
      }
    }

    if (materialParams) {
      this._materialParams = materialParams
    } else {
      this._materialParams = {
        materialType: enMaterialType.Basic,
      }
    }
  }

  public get path(): Point2D[] {
    return this._path
  }

  public set zone(value: Zone) {
    this._zone = value
  }

  public get zone(): Zone | null {
    return this._zone
  }

  public get textureParams(): TextureParams {
    return this._textureParams
  }

  public get materialParams(): MaterialParams {
    return this._materialParams
  }

  build() {}
}
